﻿// Study0401.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。
// 第四章 类和对象

#include <iostream>
class Clock
{
public:	
	void SetTime(int newH, int newM, int newS);
	void ShowTime();
private:
	int hour, minute, second;
};

void Clock::SetTime(int newH, int newM, int newS)
{
	hour = newH;
	minute = newM;
	second = newS;
}

void Clock::ShowTime()
{
	std::cout << hour << ":" << minute << ":" << second << std::endl;
}

int main()
{
	Clock myClock;
	myClock.SetTime(8, 30, 30);
	myClock.ShowTime();
	return 0;
}




